using UnityEditor;
using UnityEngine;

class MenuTest : MonoBehaviour {
    // 批量设置shader
    [MenuItem ("MLAddEditorScript/Mass Set Materials CSharp")]
    static void MassSetMaterials () {
        Undo.RegisterSceneUndo("Mass Set Materials CSharp");
		Shader shader = Selection.activeGameObject.renderer.material.shader;
		foreach(GameObject obj in Selection.gameObjects)
		{
			obj.renderer.renderer.material.shader = shader;
		}
    }
}

